//商户报备提交校验
function perform3101_freemypay() {
	// 地址拼接
	var openProvName = $("#openProvinceId").find("option:selected").text();//开户地省份
	var merNature = $("#posSaleLevel").find("option:selected").text();
	var openAreaName = $("#openCityId").find("option:selected").text();//开户地城市
	var merAddr = document.Form3101.merAddr.value.trim();//商户注册地址的详细内容
	var merProvName = $("#merProvinceId").find("option:selected").text();//商户注册地址省份
	var merCityName = $("#merCityId").find("option:selected").text();//商户注册地址城市
	var merAreaName = $("#merAreaId").find("option:selected").text();//商户注册地址地区
	var registrationNo = document.Form3101.registrationNo.value.trim();
	var regNoEn = /^[0-9a-zA-Z]*$/; // 请输入数字或字母
	var regHanzi = /^[\u4e00-\u9fa5]+$/; // 请输入汉字
	var regCnEnNo = /^[a-zA-Z0-9\u4e00-\u9fa5（）、，。！-]+$/; // 可以输入中文英文和数字
	var regCnEn = /^[a-zA-Z\u4e00-\u9fa5]+$/;// 可以输入中文英文
	var regbank = /^[\d-]+$/;
	var terminalNum = /^([1]{1}[0-9]{3}|[1-9]{1}[0-9]{0,2}|(2000))$/;
	var regterminalNum = /^(0|([1-9]\d*))$/;
	var regfeerate = /^(0|([1-9][0-9]?|((0\.[0-9][0-9][0-9][0-9])|(0\.[0-9][0-9][0-9][0-9])|([1-9]{1}[0-9]?\.([0-9])[0-9][0-9][0-9])|(0))))$/;
	var regJinE = /^((0\.[0-9][0-9])|(0\.[0-9][0-9])|([1-9]{1}[0-9]{0,8}\.([0-9])[0-9])|(0))$/;
	var emailCheck = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;// 邮箱校验
	var cusanMeenCheck =/^[A-Za-z]+$/;//商户英文名
	var ipCheck = /^(\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|1\d\d|2[0-4]\d|25[0-5])$/;//IP校验
	var pho = /^(\d{3,4})-(\d{7,8})$/;//座机号正则表达式
	var tel =/^400-([0-9]){1}([0-9-]{7})$/;//400电话正则表达式
	var mpho =/^1(3|4|5|7|8)\d{9}$/;//手机号正则表达式
	var rateCheck=/^(?!0+(\.0+)?$)\d+(\.\d+)?$/;//费率的正则表达式 
	var regAmt = document.Form3101.regAmt.value.trim();
	var vldEndDt = document.getElementById("vldEndDt").value;
	var idNo = /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/;//15/18位 如果是15位，必需全是数字 如果是18位，最后一位可以是数字或字母Xx，其余必需是数字。
	var CVV = /[0-9]{3}/; //CVV2,3位数字
	
	//商户英文名
//	var cusanMeen = document.Form3101.cusanMeen.value.trim();
//	if (document.Form3101.cusanMeen.value.trim() != "") {
//		if (!cusanMeenCheck.test(cusanMeen)) {
//			alert("商户英文名格式不正确！");
//			document.Form3101.cusanMeen.focus();
//			return;
//		}else {	
//			$("#cusanMeen1").text("");
//			$("#cusanMeen1").text(cusanMeen);
//		}
//	}
	//商户E-mail
	var email = document.Form3101.email.value.trim();
	if (document.Form3101.email.value.trim() != "") {
		if (!emailCheck.test(email)) {
			alert("商户E-mail格式不正确！");
			document.Form3101.email.focus();
			return;
		}else {
			$("#email1").text("");
			$("#email1").text(email);
		}
	} 
	//IP地址
	var serverIP = document.Form3101.serverIP.value.trim();
	//var m=0;//记录IP地址输入正确的标识
	if (document.Form3101.serverIP.value.trim() != "") {
		if (!ipCheck.test(serverIP)) {
			alert("IP地址格式不正确！");
			document.Form3101.serverIP.focus();
			return;
		}else {
			$("#serverIP1").text("");
			$("#serverIP1").text(serverIP);
		/*	var ip=serverIP.split(".");
			for(var i=0;i<ip.length;i++){
				if(ip[i].length==1 || ip[i].length==3){
					$("#serverIP1").text("");
					$("#serverIP1").text(serverIP);
					m++;
				}
			}*/
		/*	if(m==0){
				alert("IP地址每一节点都是1位或3位！");
				document.Form3101.serverIP.focus();
				return;
			}*/
			
		}
	} 
	//商户经营地区范围
	$("#occurArea1").text("");
	if(document.Form3101.occurArea[0].checked){
		$("#occurArea1").text("");
		$("#occurArea1").text("全国");
	}else if(document.Form3101.occurArea[1].checked){
		var occurArea = $("#occurArea").find("option:selected").text();//支付宝一级类目
		//occurArea=$("#occurArea").text();
		if(occurArea==null){
			alert("商户经营地区范围不能为空!");
			document.Form3101.occurArea1.focus();
			return;
		}else{
			occurArea=occurArea.toString();
			$("#occurArea1").text("");
			$("#occurArea1").text(occurArea);
		}
	}
	var certCode=document.getElementById("certCode").value.trim();
	if(certCode==""){
		alert("【法人代表证件号码】不能为空");
		return;
	}
	if(certCode!=""&&certCode.length<7){
		alert("【法人代表证件号码】不合规，请重新输入");
		return;
	}
	var Phone =document.getElementById("Phone").value;//扫码付产品客服电话
	if (Phone != "" && Phone != null) {
		if (!pho.test(Phone) && !tel.test(Phone) && !mpho.test(Phone)) {
			alert("客服电话有误！");
			document.Form3101.Phone.focus();
			return;
		}
	}
	
	var oneYardPay = document.getElementById("oneYardPay");
	var alipay = document.getElementById("alipay");
	var wechat = document.getElementById("wechat");
	var umfcode = document.getElementById("umfcode");
	if(oneYardPay.checked){
		if(!umfcode.checked&&!wechat.checked&&!alipay.checked){
			alert("开通一码付必须选择微信和支付宝或联动扫码！");
			return;
		}
		if((wechat.checked&&!alipay.checked)||(!wechat.checked&&alipay.checked)){
			alert("开通一码付必须同时开通支付宝与微信！");
			return;
		}
	}
	if(alipay.checked){
		var alipayOneId = $("#alipayOneId").find("option:selected").text();//支付宝一级类目
		var alipayTwoId = $("#alipayTwoId").find("option:selected").text();//支付宝二级类目
		var alipayThreeId = $("#alipayThreeId").find("option:selected").text();//支付宝三级类目
		var arate =document.getElementById("arate").value;//支付宝费率
		if(alipayOneId =="一级类目"){
			alert("请选择支付宝经营类目");
			document.Form3101.alipayOneId.focus();
			return;
		}else if(alipayTwoId =="二级类目"){
			alert("请选择支付宝经营类目");
			document.Form3101.alipayTwoId.focus();
			return;
		}else if(alipayThreeId =="三级类目"){
			alert("请选择支付宝经营类目");
			document.Form3101.alipayThreeId.focus();
			return;
		}else if(arate ==""){
			alert("支付宝费率不能为空");
			document.Form3101.arate.focus();
			return;
		}else if (!regfeerate.test(arate)) {
			alert("请输入正确的费率，必须为大于等于0小于100的数；若为小数，必须保留四位小数！");
			document.Form3101.arate.focus();
			return;
		}
	}
	
	if(wechat.checked){
		var wechatOneId = $("#wechatOneId").find("option:selected").text();//微信一级类目
		var wechatTwoId = $("#wechatTwoId").find("option:selected").text();//微信二级类目
		var wechatThreeId = $("#wechatThreeId").find("option:selected").text();//微信三级类目
		var wrate =document.getElementById("wrate").value;//微信费率
		if(wechatOneId =="一级类目"){
			alert("请选择微信经营类目");
			document.Form3101.wechatOneId.focus();
			return;
		}else if(wechatTwoId =="二级类目"){
			alert("请选择微信经营类目");
			document.Form3101.wechatTwoId.focus();
			return;
		}else if(wechatThreeId =="三级类目"){
			alert("请选择微信经营类目");
			document.Form3101.wechatThreeId.focus();
			return;
		}
		if(wrate ==""){
			alert("微信费率不能为空");
			document.Form3101.wrate.focus();
			return;
		}else if (!regfeerate.test(wrate)) {
			alert("请输入正确的费率，必须为大于等于0小于100的数；若为小数，必须保留四位小数！");
			document.Form3101.wrate.focus();
			return;
		}
	}
	
	if(umfcode.checked){
		var crate =document.getElementById("crate").value;//联动扫码费率
		var loginTel=document.getElementById("login_tel").value;
		if(!oneYardPay.checked){
			alert("开通联动扫码必须勾选一码付");
			document.Form3101.crate.focus();
			return;
		}
		if(crate ==""){
			alert("联动扫码费率不能为空");
			document.Form3101.crate.focus();
			return;
		}else if (!regfeerate.test(crate)) {
			alert("请输入正确的费率，必须为大于等于0小于100的数；若为小数，必须保留四位小数！");
			document.Form3101.crate.focus();
			return;
		}else if(crate<0.3){
			alert("联动扫码费率不能低于0.3%");
			document.Form3101.crate.focus();
			return;
		}
		if(loginTel==""){
			alert("登录手机号不能为空");
			document.Form3101.login_tel.focus();
			return;
		}
	}
	
	
	
	if(vldEndDt == ""){
		alert("请选择营业执照有效期");
		return;
	}
	
	var regSpecial1=/^[a-zA-Z0-9-()（）]+$/;
	var regSpecial2=/^[a-zA-Z0-9\u4e00-\u9fa5-()（）#]+$/;
	var regSpecial3=/^[a-zA-Z0-9\u4e00-\u9fa5()（）#]+$/;
	var bkAcNameCheck = /^[a-zA-Z0-9（）、()\u4e00-\u9fa5]+$/;
	var mernamesmCheck = /^[a-zA-Z0-9\u4e00-\u9fa5]{6,16}$/;
	var regMark=/^\d{25}$/;
	//终端型号校验
	var modelNames = document.getElementsByName("modelNames");
	for(var i=0;i<modelNames.length;i++){
		if(modelNames[i].value=='onselect'||modelNames[i].value==''){
			if(i!=1){
				alert("请选择终端型号！");
				modelNames[i].focus();
				return;
			}
		}
	}
	for(var i=0;i<modelNames.length-1;i++){
		if(i==1){
			continue;
		}
		for(var j=i+1;j<modelNames.length;j++){
			if(modelNames[i].value.trim()==modelNames[j].value.trim()){
				alert("终端型号存在重复！");
				modelNames[i].focus();
				return;
			}
		}
	}
	//机具数量
	var terminalNums = document.getElementsByName("terminalNums");
	//SN号
	var snNumberNums = document.getElementsByName("snNumberNums");
	for(var i=0;i<terminalNums.length;i++){
		if(terminalNums[i].value==''){
			if(i!=1){
				alert("请输入机具数量！");
				terminalNums[i].focus();
				return;
			}
		}else{
			if(!terminalNum.test(terminalNums[i].value.trim())){
				alert("机具数量必须为大于0小于等于2000的正数！");
				terminalNums[i].focus();
				return;
			}
		}
		if(snNumberNums[i].value==''){
			if(i!=1){
				alert("请导入序列号！");
				return;
			}
		}
	}
	
	
	//显示终端类型、数量
	var modelName_Num = "";
	for(var i=0;i<terminalNums.length;i++){
		if(i==1){
			continue;
		}
		modelName_Num+=modelNames[i].value+"("+terminalNums[i].value+")-"
	}
	modelName_Num = modelName_Num.substring(0, modelName_Num.length-1);
	$("#terminalNum1").text("");
	$("#terminalNum1").text(modelName_Num);
	
	// 借记卡费率
	var jfeerate = document.Form3101.jfeerate.value.trim();
	if (jfeerate == "") {
		alert("请输入借记卡费率！");
		document.Form3101.jfeerate.focus();
		return;
	} else if (!regfeerate.test(jfeerate)) {
		alert("请输入正确的借记卡费率，必须为大于等于0小于100的数；若为小数，必须保留四位小数！");
		document.Form3101.jfeerate.focus();
		return;
	} else {
		$("#jfeerate1").text("");
		$("#jfeerate1").text(jfeerate);
	}
	// 贷记卡费率   
	var dfeerate=document.Form3101.dfeerate.value.trim();
	if(dfeerate == "" ){
		alert( "请输入贷记卡费率！" ) ;
		document.Form3101.dfeerate.focus() ;
		return ;
	}else if(!regfeerate.test(dfeerate)){
		alert( "请输入正确的贷记卡费率，必须为大于等于0小于100的数；若为小数，必须保留四位小数！" ) ;
		document.Form3101.dfeerate.focus() ;
		return ;
	}else {
		$("#dfeerate1").text("");
		$("#dfeerate1").text(dfeerate);
	}
	//借记卡封顶金额
	var debitCapamt = document.getElementById("debitCapamt").value.trim();
	if (debitCapamt == "") {
		alert("请输入借记卡封顶金额！");
		document.Form3101.debitCapamt.focus();
		return;
	}
	if (!regJinE.test(debitCapamt)) {
		alert("请输入正确借记卡封顶金额,必须保留两位小数，可以为零！");
		document.Form3101.debitCapamt.focus();
		return;
	} else {
		$("#debitCapamt1").text("");
		$("#debitCapamt1").text(debitCapamt);
	}
	//贷记卡封顶金额
	var dfeeCapamt = document.getElementById("dfeeCapamt").value.trim();
	if (dfeeCapamt == "") {
		alert("请输入贷记卡封顶金额！");
		document.Form3101.dfeeCapamt.focus();
		return;
	}
	if (!regJinE.test(dfeeCapamt)) {
		alert("请输入正确贷记卡封顶金额,必须保留两位小数，可以为零！");
		document.Form3101.dfeeCapamt.focus();
		return;
	} else {
		$("#dfeeCapamt1").text("");
		$("#dfeeCapamt1").text(dfeeCapamt);
	}
	// 机具金额
	var getTermAmt = document.Form3101.getTermAmt.value.trim();
	if ((document.Form3101.getTermType[0].checked || document.Form3101.getTermType[1].checked)&& getTermAmt == "") {
		alert("请输入机具金额！");
		document.Form3101.getTermAmt.focus();
		return;
	} else if (getTermAmt!="" && !regJinE.test(getTermAmt)) {
		alert("请输入正确机具金额,必须保留两位小数，可以为零！");
		document.Form3101.getTermAmt.focus();
		return;
	} else {
		$("#getTermAmt1").text("");
		$("#getTermAmt1").text(getTermAmt);
	}
	 // 商户经营地址(装机)
	var installProvinceName = $("#installProvinceId").find("option:selected").text();//商户经营地址(装机)省份
	var installCityName = $("#installCityId").find("option:selected").text();//商户经营地址(装机)城市
	var installAreaName   = $("#installAreaId").find("option:selected").text();//商户经营地址(装机)县，区
	var installAreaInfName = $("#installAreaInfId").find("option:selected").text();//装机区域
	var installDetailAddr = document.Form3101.installDetailAddr.value.trim();//商户装机详细地址
	var installProvinceId = document.Form3101.installProvinceId.value.trim();//商户经营地址(装机)省份编码
	var installCityId = document.Form3101.installCityId.value.trim();//商户经营地址(装机)城市编码
	var installAreaId = document.Form3101.installAreaId.value.trim();//商户经营地址(装机)城市编码
	var installAreaInfId = document.Form3101.installAreaInfId.value.trim();
	if(installAreaInfId == "onselect" || installAreaInfId == "" || installAreaInfId == null){
		alert( "请选择商户经营地址(装机) 区域！" ) ;
		document.Form3101.installAreaInf.focus() ;
		return ;
	}
	$("#installAreaInf1").text("");
	console.log("装机区域名字"+installAreaInfName);
	$("#installAreaInf1").text(installAreaInfName);
	if(installProvinceId == "onselect" || installProvinceId == "" || installProvinceId == null){
		alert( "请选择商户经营地址(装机)省！" ) ;
		document.Form3101.installProvinceId.focus() ;
		return ;
	}
	if(installCityId == "onselect" || installCityId == "" || installCityId == null){
		alert( "请选择商户经营地址(装机)市！" ) ;
		document.Form3101.installCityId.focus() ;
		return ;
	}
	if(installDetailAddr == ""){
		alert( "请输入商户装机详细地址！" ) ;
		document.Form3101.installDetailAddr.focus() ;
		return ;
	}
	console.log("装机区域装机地址校验！！！");
	var merOptionNumInstall = document.getElementById("installAreaId").childNodes.length;
	if(merOptionNumInstall>1){
		if (installAreaId == "onselect" || installAreaId == "" || installAreaId == null) {
			alert("请选择商户经营地址(装机)县！");
			document.Form3101.installAreaId.focus();
			return;
		}
	}
	
	
	
	if(!regSpecial3.test(installDetailAddr)){
		alert("商户经营地址(装机)只能输入汉字、英文、数字、括号、#");
		document.Form3101.installDetailAddr.focus() ;
		return ;
	}else{
		$("#installAddr1").text("");
		if(merOptionNumInstall>1){//判断地区码是否为空，进行拼写商户注册地址
			$("#installAddr1").text(installProvinceName + "-" + installCityName + "-" + installAreaName + "-" + installDetailAddr);
			document.getElementById("installAddr").value = installProvinceName + "-" + installCityName + "-" + installAreaName + "-" + installDetailAddr;
		}else{
			$("#installAddr1").text(installProvinceName + "-" + installCityName + "-" + installDetailAddr);
			document.getElementById("installAddr").value = installProvinceName + "-" + installCityName + "-" + installDetailAddr;
		}
	}
	

	if (merNature == "企业") {
		if (regAmt == "") {
			alert("请输入注册资金！");
			document.Form3101.regAmt.focus();
			return;
		}
	}
	if (document.Form3101.regAmt.value.trim() != "") {
		if (!regJinE.test(regAmt)) {
			alert("请输入正确注册资金金额,必须保留两位小数，可以为零！");
			document.Form3101.regAmt.focus();
			return;
		} else {
			$("#regAmt1").text("");
			$("#regAmt1").text(regAmt);
		}
	}

	var bkAcName = document.Form3101.bkAcName.value.trim();
	if (document.Form3101.bkAcName.value.trim() == "") {
		alert("请输入银行户名！");
		document.Form3101.bkAcName.focus();
		return;
	} else if (!bkAcNameCheck.test(bkAcName)) {
		alert("银行户名可以输入中文英文数字和括号！");
		document.Form3101.bkAcName.focus();
		return;
	} else {
		$("#bkAcName1").text("");
		$("#bkAcName1").text(bkAcName);
	}

	var majarBusi = document.Form3101.majarBusi.value.trim();
	if (document.Form3101.majarBusi.value.trim() == "") {
		alert("请输入主营业务！");
		document.Form3101.majarBusi.focus();
		return;
	} else if (!regCnEnNo.test(majarBusi)) {
		alert("主营业务可以输入中文英文数字和中文符号！");
		document.Form3101.majarBusi.focus();
		return;
	} else {
		$("#majarBusi1").text("");
		$("#majarBusi1").text(majarBusi);
	}

	if (merNature == "企业") {
		if (registrationNo == "") {
			alert("请输入组织机构代码！");
			document.Form3101.registrationNo.focus();
			return;
		}
	}
	if(document.Form3101.registrationNo.value.trim() != ""){
		if(!regSpecial1.test(registrationNo)){
			alert("组织机构代码只能输入数字、字母、括号和连接符-");
			document.Form3101.registrationNo.focus();
			return;
		} else {
			$("#registrationNo1").text("");
			$("#registrationNo1").text(registrationNo);
		}
	}
	/*var branceName = document.Form3101.branceName.value.trim();
	if (branceName != "") {
		if (!regCnEn.test(branceName)) {
			alert("支行名称可以输入中文或字母");
			document.Form3101.branceName.focus();
			return;
		} else {
			$("#branceName1").text("");
			$("#branceName1").text(branceName);
		}
	}*/
	
	var branceName = document.Form3101.branceName.value.trim();
	if (document.Form3101.branceName.value.trim() == "") {
		alert("请输入支行名称！");
		document.Form3101.branceName.focus();
		return;
	} else if (!regCnEn.test(branceName)) {
		alert("支行名称可以输入中文或字母！");
		document.Form3101.branceName.focus();
		return;
	} else {
		$("#branceName1").text("");
		$("#branceName1").text(branceName);
	}

	var remark = document.Form3101.remark.value.trim();
	if (remark != "") {
		if (!regCnEnNo.test(remark)) {
			alert("备注可以输入中文英文和数字");
			document.Form3101.remark.focus();
			return;
		} else {
			$("#remark1").text("");
			$("#remark1").text(remark);
		}
	}
	
	var licenseNo=document.Form3101.licenseNo.value.trim();
	if(licenseNo==""){
		alert( "请输入营业执照号！" ) ;
		document.Form3101.licenseNo.focus() ;
		return ;
	}else if(!regSpecial1.test(licenseNo)){
		alert("营业执照号只能输入数字、字母、括号和连接符-");
		document.Form3101.licenseNo.focus();
		return;
	} else {
		$("#licenseNo1").text("");
		$("#licenseNo1").text(licenseNo);
	}
	var contrId=document.Form3101.contrId.value.trim();
	if(contrId == ""){
		alert("协议编号不能为空");
		document.Form3101.contrId.focus();
		return ;
	}else if(!regSpecial1.test(contrId)){
		alert("协议编号只能输入数字、字母、括号和连接符-");
		document.Form3101.contrId.focus();
		return;
	} else {
		$("#contrId1").text("");
		$("#contrId1").text(contrId);
	}

	var lawyer = document.Form3101.lawyer.value.trim();
	if (lawyer == "") {
		alert("请输入法人代表姓名！");
		document.Form3101.lawyer.focus();
		return;
	} else if (!regCnEn.test(lawyer)) {
		alert("法人代表姓名可以输入中文或字母");
		document.Form3101.lawyer.focus();
		return;
	} else {
		$("#lawyer1").text("");
		$("#lawyer1").text(lawyer);
	}
	var regcertCode = /^[0-9a-zA-Z]*$/;
	var certCode = document.Form3101.certCode.value.trim();
	if (certCode == "") {
		alert("请输入法人代表证件号！");
		document.Form3101.certCode.focus();
		return;
	} else if (!regcertCode.test(certCode)) {
		alert("法人代表证件号必须为数字或字母！");
		document.Form3101.certCode.focus();
		return;
	} else {
		$("#certCode1").text("");
		$("#certCode1").text(certCode);
	}
	// 结算类型
	var cusanMeen = document.Form3101.cusanMeen.value;//结算类型
	var settleIdNo = document.Form3101.settleIdNo.value.trim();//结算人身份证号
	if(cusanMeen==''){
		alert("请选择结算类型！");
		return;
	}else if (document.Form3101.cusanMeen[0].checked) {
		$("#settleIdNo1").text("");
		$("#cusanMeen1").text("对公");
	} else if (document.Form3101.cusanMeen[1].checked) {
		$("#settleIdNo1").text("");
		$("#cusanMeen1").text("对私");
		if (settleIdNo == "") {
			alert("请输入结算人身份证号！");
			document.Form3101.settleIdNo.focus();
			return;
		} else if (!regcertCode.test(settleIdNo)) {
			alert("结算人身份证号必须为数字或字母！");
			document.Form3101.settleIdNo.focus();
			return;
		} else {
			$("#settleIdNo1").text("");
			$("#settleIdNo1").text(settleIdNo);
		}
		
	}
	var bankName = document.Form3101.bankName.value.trim();
	if (bankName== "onselect" || bankName== "") {
		alert("请输入银行名称！");
		document.Form3101.bankName.focus();
		return;
	} else {
		$("#bankName1").text("");
		$("#bankName1").text(bankName);
	}
	
	var bkAcId = document.Form3101.bkAcId.value.trim();
	if (bkAcId == "") {
		alert("请输入银行帐号！");
		document.Form3101.bkAcId.focus();
		return;
	} else if (!regbank.test(bkAcId)) {
		alert("银行账号全部为数字也可以包含-！");
		document.Form3101.bkAcId.focus();
		return;
	} else {
		$("#bkAcId1").text("");
		$("#bkAcId1").text(bkAcId);
	}
	var busiName=document.Form3101.busiName.value.trim();
	if( document.Form3101.busiName.value.trim() == "" ){
		alert( "请输入商户名称！" ) ;
		document.Form3101.busiName.focus() ;
		return ;
	}else if(!bkAcNameCheck.test(busiName)){
		alert( "商户名称可以输入中文英文数字和括号！" ) ;
		document.Form3101.busiName.focus() ;
		return ;
	}else {
		$("#busiName1").text("");
		$("#busiName1").text(busiName);
	}

	if( document.Form3101.merAddr.value.trim() == "" ){
		alert( "请输入除省市外的详细地址！" ) ;
		document.Form3101.merAddr.focus() ;
		return ;
	}else if(!regSpecial2.test(merAddr)){
		alert( "详细地址只能输入汉字、英文、数字、括号、#和连接符-" ) ;
		document.Form3101.merAddr.focus() ;
		return ;
	}
	var regHanzi = /^[\u4e00-\u9fa5]+$/;
	var linkMan = document.Form3101.linkMan.value.trim();
	if (linkMan == "") {
		alert("请输入商户联系人！");
		document.Form3101.linkMan.focus();
		return;
	} else if (!regHanzi.test(linkMan)) {
		alert("商户联系人必须为汉字");
		document.Form3101.linkMan.focus();
		return;
	} else {
		$("#linkMan1").text("");
		$("#linkMan1").text(linkMan);
	}

	if (document.Form3101.mobileId.value.trim() == "") {
		alert("请输入商户联系电话(手机)！");
		document.Form3101.mobileId.focus();
		return;
	}
	if (!checkMp(document.Form3101.mobileId)) {
		alert("商户联系电话(手机)格式不正确！");
		document.Form3101.mobileId.focus();
		return;
	} else {
		$("#mobileId1").text("");
		$("#mobileId1").text(document.Form3101.mobileId.value.trim());
	}
	//联系人地址
	var linkManProvinceName = $("#linkManProvinceId").find("option:selected").text();//联系人地址省份
	var linkManCityName = $("#linkManCityId").find("option:selected").text();//联系人地址城市
	var linkManAddr = document.Form3101.linkManAddr.value.trim();//联系人详细地址
	var linkManProvinceId = document.Form3101.linkManProvinceId.value.trim();//联系人地址省份编码
	var linkManCityId = document.Form3101.linkManCityId.value.trim();//联系人地址城市编码
	if(linkManProvinceId == "onselect" || linkManProvinceId == "" || linkManProvinceId == null){
		alert( "请选择联系人地址省！" ) ;
		document.Form3101.linkManProvinceId.focus() ;
		return ;
	}
	if(linkManCityId == "onselect" || linkManCityId == "" || linkManCityId == null){
		alert( "请选择联系人地址市！" ) ;
		document.Form3101.linkManCityId.focus() ;
		return ;
	}
	if(linkManAddr == ""){
		alert( "请输入联系人详细地址！" ) ;
		document.Form3101.linkManAddr.focus() ;
		return ;
	}
	if(!regSpecial2.test(linkManAddr)){
		alert( "联系人地址只能输入汉字、英文、数字、括号、#和连接符-" ) ;
		document.Form3101.linkManAddr.focus() ;
		return ;
	}else{
		$("#linkManTec1").text("");
		$("#linkManTec1").text(linkManProvinceName + "-" + linkManCityName + "-" + linkManAddr);
	}
	document.getElementById("linkManTec").value = linkManProvinceName + "-" + linkManCityName + "-" + linkManAddr;//拼联系人地址，供action接收
	
	
	/*var linkManTec= document.Form3101.linkManTec.value.trim();
	if( document.Form3101.linkManTec.value.trim() == "" ){
		alert( "请输入联系人地址！" ) ;
		document.Form3101.linkManTec.focus() ;
		return ;
	}else if(!regSpecial2.test(linkManTec)){
		alert( "联系人地址只能输入汉字、英文、数字、括号、#和连接符-" ) ;
		document.Form3101.linkManTec.focus() ;
		return ;
	}else {
		$("#linkManTec1").text("");
		$("#linkManTec1").text(linkManTec);
	}*/
	var mernamesm = document.Form3101.mernamesm.value.trim();
	if (document.Form3101.mernamesm.value.trim() == "") {
		alert("请输入商户简称！");
		document.Form3101.mernamesm.focus();
		return;
	} else if (!mernamesmCheck.test(mernamesm)) {
		alert("商户简称可以输入6-16位的中文英文数字！");
		document.Form3101.mernamesm.focus();
		return;
	} else {
		$("#mernamesm1").text("");
		$("#mernamesm1").text(mernamesm);
	}

	var empoNum = document.Form3101.empoNum.value.trim();
	if (document.Form3101.empoNum.value.trim() == "") {
		alert("请输入员工数量！");
		document.Form3101.empoNum.focus();
		return;
	} else if (!isNumber(empoNum)) {
		alert("员工数量必须为数字");
		document.Form3101.empoNum.focus();
		return;
	} else {
		$("#empoNum1").text("");
		$("#empoNum1").text(empoNum);
	}

	var linkTelEmail = document.Form3101.linkTelEmail.value.trim();
	if (document.Form3101.linkTelEmail.value.trim() != "") {
		if (!emailCheck.test(linkTelEmail)) {
			alert("联系人邮箱格式不正确！");
			document.Form3101.linkTelEmail.focus();
			return;
		}else {
			$("#linkTelEmail1").text("");
			$("#linkTelEmail1").text(linkTelEmail);
		}
	} 
	if (document.Form3101.zipCd.value.length != 0) {
		if (document.Form3101.zipCd.value.length != 6
				|| !isNumber(document.Form3101.zipCd)) {
			alert("邮编格式错误！");
			document.Form3101.zipCd.focus();
			return;
		} else {
			$("#zipCd1").text("");
			$("#zipCd1").text(document.Form3101.zipCd.value);
		}
	}/* else {
		alert("邮编不能为空！");
		document.Form3101.zipCd.focus();
		return;
	}*/
	var telPhone = document.Form3101.telPhone.value.trim();
	var reg = /^(\d{3,4})-(\d{7,8})$/;
	if (telPhone != "" && telPhone != null) {
		if (!reg.test(telPhone)) {
			alert("固定电话格式为:区号(3-4位)-电话号码(7-8位)！");
			document.Form3101.telPhone.focus();
			return;
		} else {
			$("#telPhone1").text("");
			$("#telPhone1").text(telPhone);
		}
	}

	var openProvinceId = $('#openProvinceId option[selected]').val();//得到开户地省份编码
	if (openProvinceId == "onselect" || openProvinceId == "" || openProvinceId == null) {
		alert("请选择开户省！");
		document.Form3101.openProvinceId.focus();
		return;
	}
	var openCityId = $('#openCityId option[selected]').val();//得到开户地城市编码
	if (openCityId == "onselect" || openCityId == "" || openCityId == null) {
		alert("请选择开户市！");
		document.Form3101.openCityId.focus();
		return;
	}
	document.getElementById('addressChn').value = openProvName + "-"+ openAreaName;//开户地省市编码拼写
	var merProvinceId = document.Form3101.merProvinceId.value;//得到商户注册地址省份编码
	if (merProvinceId == "onselect" || merProvinceId == "" || merProvinceId == null) {
		alert("请选择商户注册地址省份！");
		document.Form3101.merProvinceId.focus();
		return;
	}
	var merCityId = document.Form3101.merCityId.value;//得到商户注册地址城市编码
	if (merCityId == "onselect" || merCityId == "" || merCityId == null) {
		alert("请选择商户注册地址城市！");
		document.Form3101.merCityId.focus();
		return;
	}
	var merAreaId = document.Form3101.merAreaId.value;//得到商户注册地址地区编码
	var merOptionNum = document.getElementById("merAreaId").childNodes.length;
	if(merOptionNum>1){
		if (merAreaId == "onselect" || merAreaId == "" || merAreaId == null) {
			alert("请选择商户注册地址地区！");
			document.Form3101.merAreaId.focus();
			return;
		}
	}
	if(merOptionNum>1){//判断地区码是否为空，进行拼写商户注册地址
		document.getElementById("busiAddr").value = merProvName + "-" + merCityName + "-" + merAreaName + "-" + merAddr;
	}else{
		document.getElementById("busiAddr").value = merProvName + "-" + merCityName + "-" + merAddr;
	}
	
	if (document.Form3101.dateOpen.value.trim() == "") {
		alert("请输入成立日期！");
		document.Form3101.dateOpen.focus();
		return;
	} else {
		$("#dateOpen1").text("");
		$("#dateOpen1").text(document.Form3101.dateOpen.value.trim());
	}
	// 复选框
	var modelType = "";
	var models = document.getElementsByName("model");

	for ( var i = 0; i < models.length; i++) {
		if (models[i].checked) { // 判断复选框是否选中
			modelType = modelType + models[i].value; // 值的拼凑 .. 具体处理看你的需要,
		}
	}
	document.getElementById("modelType").value = modelType;
	if (modelType.length == '0') {
		alert("请选择机具类型");
		return;
	}
	//提现类型单选
	/*var withdrawType=$('input[name="withdrawType"]:checked').val();
	if(withdrawType==null||withdrawType==""){
		alert("请选择提现类型");
		return;
	}else{
		$("#withdrawType1").text("");
		$("#withdrawType1").text(withdrawType);
	}*/
	
	
	
	
	//提现类型多选
	var withdrawType = "";
	var withdrawType2 ="";
	var withdrawType3="";
	var withdraws = document.getElementsByName("withdraw");
	var accountNameAuth=document.getElementById("accountNameAuth").value;//结算人姓名
	var idNoAuth=document.getElementById("idNoAuth").value;//身份证号
	var cardNoCipher=document.getElementById("cardNoCipher").value;//信用卡号
	var mobileIdAuth=document.getElementById("mobileIdAuth").value;//银行预留手机号
	var CVV2=document.getElementById("CVV2").value;//CVV2
	var endDate=document.getElementById("endDate").value;//有效期
	var bankCardNameList=document.getElementById("bankCardNameList").value;//所属银行
	for(var i = 0; i < withdraws.length; i++){
		if (withdraws[i].checked) { // 判断复选框是否选中
			withdrawType = withdrawType + withdraws[i].value+","; // 值的拼凑 .. 具体处理看你的需要,
			if(withdraws[i].value=="D0"){
				if($("#rateD0").val()==""){
					alert("请输入D0费率(%)");
					return;
				}
				if($("#rateD0").val()<"0.02"){
					alert("D0费率不能低于0.02%");
					return;
				}else{
					if(accountNameAuth!=""){
						if(idNoAuth!=""||cardNoCipher!=""||mobileIdAuth!=""||CVV2!=""||endDate!=""){
							if(idNoAuth!=""&&cardNoCipher!=""){//信用卡和身份证号都不为空时 去校验填写数据是否正确
							if(idNoAuth!=""){
								if(!idNo.test(idNoAuth)){
									alert("实名认证信息【身份证号】格式不正确")
									document.Form3101.idNoAuth.focus();
									return;
								}
							}
							if(cardNoCipher!=""){
								if(!regbank.test(cardNoCipher)){
									alert("实名认证信息【信用卡卡号】格式不正确")
									document.Form3101.cardNoCipher.focus();
									return;
								}else{
									if(bankCardNameList==""){
										alert("实名认证信息填写了信用卡卡号【所属银行】必填")
										document.Form3101.bankCardNameList.focus();
										return;
									}
								}
							}
							if(mobileIdAuth!=""){
								if(!mpho.test(mobileIdAuth)){
									alert("实名认证信息【银行预留手机号】格式不正确")
									document.Form3101.mobileIdAuth.focus();
									return;
								}
							}
							if(CVV2!=""){
								if(!CVV.test(CVV2)){
									alert("实名认证信息【CVV2】格式不正确")
									document.Form3101.CVV2.focus();
									return;
								}
							}
							}else{
								if(idNoAuth==""){
									alert("实名认证信息【身份证号】不能为空")
									document.Form3101.idNoAuth.focus();
									return;
								}
								if(cardNoCipher==""){
									alert("实名认证信息【信用卡卡号】不能为空")
									document.Form3101.cardNoCipher.focus();
									return;
								}
							}
						}
					}
				}
				if(idNoAuth!=null||idNoAuth!=''){
					$("#idNo_Auth").text($("#idNoAuth").val());
				}
				if(accountNameAuth!=null||accountNameAuth!=''){
					$("#accountName_Auth").text($("#accountNameAuth").val());
				}
				if(cardNoCipher!=null||cardNoCipher!=''){
					$("#cardNoCipherAuth").text($("#cardNoCipher").val());
				}
				if(mobileIdAuth!=null||mobileIdAuth!=''){
					$("#mobileId_Auth").text($("#mobileIdAuth").val());
				}
				if(CVV2!=null||CVV2!=''){
					$("#CVV2Auth").text($("#CVV2").val());
				}
				if(endDate!=null||endDate!=''){
					$("#endDateAuth").text($("#endDate").val());
				}
				if(bankCardNameList!=null||bankCardNameList!=''){
					$("#bankCardNameAuth").text($("#bankCardNameList").val());
				}
				if (document.Form3101.login_tel.value.trim() == "") {
					alert("请输入登录手机号！");
					document.Form3101.login_tel.focus();
					return;
				}
				if (!checkMp(document.Form3101.login_tel)) {
					alert("登记手机号格式不正确！");
					document.Form3101.login_tel.focus();
					return;
				} else {
					$("#login_tel1").text("");
					$("#login_tel1").text(document.Form3101.login_tel.value.trim());
				}
			}
	
			if(withdraws[i].value=="D1"){
				if($("#rateD1").val()==""){
					alert("请输入D1费率(%)");
					return;
				}
				//校验参加优惠活动是否为空
				var isDiscount=document.getElementById("isDiscount").value;
				if(typeof(isDiscount)=='undefined'){
					alert("参加优惠活动必须选'是'或'否'");
					document.Form3101.isDiscount.focus();
					return;
				}
				if (document.Form3101.login_tel.value.trim() == "") {
					alert("请输入登录手机号！");
					document.Form3101.login_tel.focus();
					return;
				}
				if (!checkMp(document.Form3101.login_tel)) {
					alert("登录手机号格式不正确！");
					document.Form3101.login_tel.focus();
					return;
				} else {
					$("#login_tel1").text("");
					$("#login_tel1").text(document.Form3101.login_tel.value.trim());
				}
		    }
	    }
    }
	
	var newwithdrawType = withdrawType.substring(0,withdrawType.length-1);
	document.getElementById("withdrawType").value = newwithdrawType;
	if(newwithdrawType.indexOf("D0")!=-1){
		withdrawType2 = "实时结算D0";
		$("#rateD01").text("");
		$("#rateD01").text($("#rateD0").val());
	}
	if(newwithdrawType.indexOf("D1")!=-1){
		withdrawType2="节假日结算D1";
		$("#rateD11").text("");
		$("#rateD11").text($("#rateD1").val());
	}
	
	if(newwithdrawType.indexOf("D0")!=-1&&newwithdrawType.indexOf("D1")!=-1){
		withdrawType2="实时结算D0-节假日结算D1"
		$("#rateD01").text("");
		$("#rateD01").text($("#rateD0").val());
		$("#rateD11").text("");
		$("#rateD11").text($("#rateD1").val());
	}
		$("#withdrawType1").text("");
		$("#withdrawType1").text(withdrawType2);
	
	//是否参加优惠活动
		if (document.Form3101.isDiscount[0].checked) {
		$("#isDiscount11").text("是");
		} else if (document.Form3101.isDiscount[1].checked) {
		$("#isDiscount11").text("否");
		} else {
		$("#isDiscount11").text("");
		}
	
	//登陆手机号
	var tel=document.getElementById("login_tel").value;
	if(tel.trim() !=""){
		$("#login_tel1").text("");
		$("#login_tel1").text(tel);
	}
	// 商户注册地址
	if(merOptionNum>1){
		$("#merAddress1").text("");
		$("#merAddress1").text(merProvName + "-" + merCityName + "-" + merAreaName + "-" + merAddr);
	}else{
		$("#merAddress1").text("");
		$("#merAddress1").text(merProvName + "-" + merCityName + "-" + merAddr);
	}
	
	// 开户地
	$("#openAddress1").text("");
	$("#openAddress1").text(openProvName + "-" + openAreaName);
	// 营业执照有效期
	$("#vldEndDt1").text("");
	$("#vldEndDt1").text(vldEndDt);
	
	//申请商户类别(确认提交的时候需要用到)
	var hyType = $("#hyType").find("option:selected").text();
	$("#hyType1").text("");
	$("#hyType1").text(hyType);
	
	//进行验证标准类是否包含（商户类别的标准类、其他类）,减免类是否包含（非营利性医疗机构、非营利性教育机构、非营利性慈善及社会福利机构），优惠类包含（除标准类和减免类包含的）。
	hyType=$("#hyType").find("option:selected").val();
	if(document.Form3101.applyShType[0].checked){
		$("#applyShType1").text("标准类");
	}else if (document.Form3101.applyShType[1].checked) {
		if("15"!=hyType && "16"!=hyType && "17"!=hyType && "18"!=hyType){
    	  	alert("您填写的商户所属的行业类别不能申请成为商户申请的商户类别");
    	  	document.Form3101.hyType.focus();
			return;
    	  }
		$("#applyShType1").text("优惠类");
		
	}else if (document.Form3101.applyShType[2].checked) {
		if("19"!=hyType && "20"!=hyType && "21"!=hyType){
    	  	alert("您填写的商户所属的行业类别不能申请成为商户申请的商户类别");
    	  	document.Form3101.hyType.focus();
			return;
    	  }
		$("#applyShType1").text("减免类");
	}
	
	// 是否开通额外业务
	var addBusiness = $("#addBusiness").find("option:selected").text();
	$("#addBusiness1").text("");
	$("#addBusiness1").text(addBusiness);
	var registrationMark = document.Form3101.registrationMark.value.trim();
	if(document.Form3101.registrationMark.value.trim() != ""){
		if(!regMark.test(registrationMark)){
			alert("现场注册标识只能为25位数字");
			document.Form3101.registrationMark.focus();
			return;
		}else{
			$("#registrationMark1").text("");
			$("#registrationMark1").text(registrationMark);
		}
	}

	// 营业开始时间
	var starttime = document.getElementById("starttime").value;
	$("#starttime1").text("");
	$("#starttime1").text(starttime);
	// 营业结束时间
	var endtime = document.getElementById("endtime").value;
	$("#endtime1").text("");
	$("#endtime1").text(endtime);
	// 机具类型tempStr.indexOf
	var model_type="";
	if (modelType.indexOf("0") != -1) {
		model_type = "网络";
	}
	if (modelType.indexOf("1") != -1) {
		if(model_type==""){
			model_type = "移动";
		}else{
			model_type = model_type + "-移动";
		}
	}
	if (modelType.indexOf("2") != -1) {
		if(model_type==""){
			model_type = "U刷";
		}else{
			model_type = model_type + "-U刷";
		}
	}
	$("#modelType1").text("");
	$("#modelType1").text(model_type);
	// 机具模式
	if (document.Form3101.getTermType[0].checked) {
		$("#getTermType1").text("租赁");
	} else if (document.Form3101.getTermType[1].checked) {
		$("#getTermType1").text("购买");
	} else if (document.Form3101.getTermType[2].checked) {
		$("#getTermType1").text("自购");
	}
	
	//商户类型
	$("#posSaleLevel1").text("");
	$("#posSaleLevel1").text(merNature);
	//法人代表证件类型
	var ciertiType = $("#ciertiType").find("option:selected").text();
	$("#ciertiType1").text("");
	$("#ciertiType1").text(ciertiType);
	document.getElementById("Button4").click();
	// 商户组别
//	var merGroup = document.Form3101.merGroup.value.trim();
	var merGroup = $("#merGroup").find("option:selected").text();
	$("#merGroup1").text("");
	$("#merGroup1").text(merGroup);
	// 银联直联分公司
	var upayBranchCode = $("#upayBranchCode").find("option:selected").text();
	$("#upayBranchCode1").text("");
	$("#upayBranchCode1").text(upayBranchCode);
	
	//预授权
	var preState="";
	var preStates = document.getElementsByName("preStateType");
	if (preStates[0].checked) { // 判断复选框是否选中
		preState = preStates[0].value; 
		$("#preState1").text("");
		$("#preState1").text("申请开通预授权");
		document.getElementById("preState").value = preState;
	}else{
		preState = "1" ;
		$("#preState1").text("");
		$("#preState1").text("不开通预授权");
		document.getElementById("preState").value = preState;
	}
	
	$("#phone").text(Phone);
	//是否开通支付宝
	if (alipay.checked) { // 判断复选框是否选中
		$("#alipayType").text("已开通");
		$("#alipayRate").text(arate+"%");
		$("#alipayCategory").text(alipayOneId+"-"+alipayTwoId+"-"+alipayThreeId);
	}else{
		$("#alipayType").text("未开通");
	}
	//是否开通微信
	if (wechat.checked) { // 判断复选框是否选中
		$("#wechatType").text("已开通");
		$("#wechatRate").text(wrate+"%");
		$("#wechatCategory").text(wechatOneId+"-"+wechatTwoId+"-"+wechatThreeId);
	}else{
		$("#wechatType").text("未开通");
	}
	//是否开通联动扫码
	if(umfcode.checked){ // 判断复选框是否选中
		$("#umfcodeType").text("已开通");
		$("#umfcodeRate").text(crate+"%");
	}else{
		$("#umfcodeType").text("未开通");
	}
	//是否开通一码付
	if (oneYardPay.checked) { // 判断复选框是否选中
		$("#oneYardType").text("已开通");
	}else{
		$("#oneYardType").text("未开通");
	}
	/*
	 * document.Form3101.submit(); document.Form3101.merAdd.disable=true;
	 */

	
	
}
